@extends("layouts.common")
@section("content")
    <div class="row">
        <div class="col-lg-12">
            @if (isset($errors) && count($errors) > 0)
                <div class="alert alert-danger alert-dismissible">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                    <h4><i class="icon fa fa-ban"></i> 错误</h4>
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
                @if (Session::has('messages'))
                    <div class="alert alert-success alert-dismissible">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                        <h4><i class="icon fa fa-check"></i> 成功!</h4>
                        <ul>
                            @foreach (Session::get('messages') as $error)
                                <li>{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                @endif
        </div>
    </div>

    <div class="row error" style="display: none">
        <div class="col-lg-12">
                <div class="alert alert-danger alert-dismissible">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                    <h4><i class="icon fa fa-ban"></i> 错误</h4>
                    <ul>
                            <li></li>
                    </ul>
                </div>
        </div>
    </div>


    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><i class="fa fa-table"></i>我的代理</h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="/welcome">Home</a></li>
                <li><i class="fa fa-table"></i><a href="/agent">我的代理</a></li>
                <li><i class="fa fa-indent"></i>结算</li>
            </ol>
        </div>
    </div>

    <div class="row">

        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2><i class="fa fa-indent red"></i><strong>结算</strong></h2>
                </div>
                <form action="" method="post" enctype="multipart/form-data" class="form-horizontal ">
                <div class="panel-body">
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="email-input">账户余额</label>
                            <div class="col-md-9">
                                <input type="text" id="text-input" name="money" disabled class="form-control" value="{{$info->money}}"  required>
                            </div>
                        </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label" for="email-input">留存比</label>
                        <div class="col-md-9">
                            <input type="text" id="text-input" name="remain" readonly class="form-control" value="{{$info->remain}}"  required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label" for="email-input">结算金额</label>
                        <div class="col-md-9">
                            <input type="text" id="text-input" name="pay" readonly class="form-control" value="{{intval($info->money * (100-intval($info->remain))/100)}}"  required>
                        </div>
                    </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="email-input">银行卡号</label>
                            <div class="col-md-9">
                                <input type="text" id="text-input" name="bankcard" readonly class="form-control" value="{{$info->bankcard}}"  required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="email-input">流水单号</label>
                            <div class="col-md-9">
                                <input type="text" id="text-input" name="number" class="form-control" value="{{!empty(old('number'))?old('number'):''}}"  required>
                            </div>
                        </div>
                        <input type="hidden" name="id" value="{{$info->id}}">
                        {!! csrf_field() !!}

                </div>
                <div class="panel-footer">
                    <div class="col-md-2"></div>
                    <div> <button type="submit" class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> Submit</button></div>

                </div>
                </form>
            </div>
        </div>
    </div>
    <script>

    </script>
    <style>
        td,th{
            text-align: center;
        }
    </style>
@endsection